package app.fichajes.utils;


public class StringUtils {

	/**
	 * Hace posible transformar el String "Pallar�s" en "pallares"
	 * Ejemplo:
	 *  String a = "pallares";
        String b = "Pallar�s";
        String c = transformaString(b);
        
        if(a.equals(c))
        	Log.d("Main"," iguales: "+a+" -- "+c);
        else
        	Log.d("Main", " rabo: "+a+" -- "+c);
        	
	 * @param s
	 * @return
	 */
	public static String transformaString(String s){
    	String resul = "";
    	String aux;
    	
    	int longitudCadena = s.length();
    	for(int i = 0; i<longitudCadena; i++){
    		char c = s.charAt(i);
    		aux = String.valueOf(c).toLowerCase();
    		
    		if(aux.equals("á"))
    			aux = "a";
    		else if(aux.equals("é"))
    			aux = "e";
    		else if(aux.equals("í"))
    			aux = "i";
    		else if(aux.equals("ó"))
    			aux = "o";
    		else if(aux.equals("ú"))
    			aux = "u";
    		
    		resul += aux;
    	}
    	
    	return resul;
    }
}
